class Solution {
public:
    bool isAnagram(string s, string t) {
        vector<int> hash1(26);
        vector<int> hash2(26);
        for(char &ch : s)
            hash1[ch - 'a']++;
        for(char &ch : t)
            hash2[ch - 'a']++;
        return hash1 == hash2;
    }
};